<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>控制媒体回放2</title>
</head>
<body>
<div>
    <button id="playback-controller">Play</button>
    <button id="mute-controller">Mute</button>
</div>
<video id="ddd-video">
    <source src="">
    <source src="">
</video>
<script>
    function playbackClick(e) {
        var target = e.target;
        var video = document.getElementById('bbb-video');
        if (target.innerHTML == 'Play') {
            video.play();
            target.innerHTML = 'Pause';
        } else {
            video.pause();
            target.innerHTML = 'Resume';
        }
    }

    function muteClick(e) {
        var target = e.target;
        var video = document.getElementById('bbb-video');
        if (video.muted) {
            video.muted = false;
            target.innerHTML = 'Mute';
        } else {
            video.muted = true;
            target.innerHTML = 'Unmute';
        }
    }

    document.getElementById('playback-controller').addEventListener('click', playbackClick);
    document.getElementById('mute-controller').addEventListener('click', muteClick);
</script>
</body>
</html>